package com.java.yz.day15.Idlerman;

public class Student {
    private static Student student;
    private Student(){}

    public static synchronized Student getStudent(){
        if (student == null){  //所以这里会有线程安全的问题，所以要加一个关键字synchronized
            return student=new Student();
        }
        else {
            return student;
        }
    }
}
